return true;
}
-
$dbr = wfGetDB( DB_SLAVE );
$row = $dbr->selectRow(
'category',
__METHOD__
);
-
if ( !$row ) {
# Okay, there were no contents. Nothing to initialize.
if ( $this->mTitle ) {
)
);
-
return $result;
}
}
}
-
$dbw = wfGetDB( DB_MASTER );
$dbw->startAtomic( __METHOD__ );
);
$dbw->endAtomic( __METHOD__ );
-
# Now we should update our local counts.
$this->mPages = $result->pages;
$this->mSubcats = $result->subcats;
return;
}
-
$this->isConflict = false;
// css / js subpages of user pages get a special treatment
$this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
function importFormData( &$request ) {
global $wgContLang, $wgUser;
-
# Section edit can come from either the form or a link
$this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) );
protected function getContentObject( $def_content = null ) {
global $wgOut, $wgRequest, $wgUser, $wgContLang;
-
$content = false;
// For message page not locally set, use the i18n message.
$status = Status::newGood();
-
if ( !Hooks::run( 'EditPage::attemptSave', array( $this ) ) ) {
wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" );
$status->fatal( 'hookaborted' );
$code = $wgUser->isAnon() ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED;
$status->setResult( false, $code );
-
return $status;
}
return $status;
}
-
# Load the page data from the master. If anything changes in the meantime,
# we detect it by using page_latest like a token in a 1 try compare-and-swap.
$this->mArticle->loadPageData( 'fromdbmaster' );
function showEditForm( $formCallback = null ) {
global $wgOut, $wgUser;
-
# need to parse the preview early so that we know which templates are used,
# otherwise users with "show preview after edit box" will get a blank list
# we parse this near the beginning so that setHeaders can do the title
return '';
}
-
$limitReport = Html::rawElement( 'div', array( 'class' => 'mw-limitReportExplanation' ),
wfMessage( 'limitreport-title' )->parseAsBlock()
);
Html::closeElement( 'table' ) .
Html::closeElement( 'div' );
-
return $limitReport;
}
global $wgOut, $wgUser, $wgRawHtml, $wgLang;
global $wgAllowUserCss, $wgAllowUserJs;
-
if ( $wgRawHtml && !$this->mTokenOk ) {
// Could be an offsite preview attempt. This is very unsafe if
// HTML is enabled, as it could be an attack.
$this->parseHeader();
$this->setStatus();
-
return $this->status;
}
}
fclose( $fh );
-
return $this->status;
}
}
) {
wfDeprecated( __METHOD__, '1.21' );
-
if ( $text == '' ) {
$text = self::linkText( $title );
}
private function performRequest() {
global $wgTitle;
-
$request = $this->context->getRequest();
$requestTitle = $title = $this->context->getTitle();
$output = $this->context->getOutput();
echo "Waiting for a database server: $lag seconds lagged\n";
}
-
exit;
}
}
private function main() {
global $wgTitle;
-
$request = $this->context->getRequest();
// Send Ajax requests to the Ajax dispatcher.
return; // recursion guard
}
-
if ( $jobRunRate < 1 ) {
$max = mt_getrandmax();
if ( mt_rand( 0, $max ) > $max * $jobRunRate ) {
) {
global $wgParser;
-
$popts = $this->parserOptions();
$oldTidy = $popts->setTidy( $tidy );
$popts->setInterfaceMessage( (bool)$interface );
return;
}
-
$response = $this->getRequest()->response();
$config = $this->getConfig();
public function headElement( Skin $sk, $includeStyle = true ) {
global $wgContLang;
-
$userdir = $this->getLanguage()->getDir();
$sitedir = $wgContLang->getDir();
public function insertOn( $dbw ) {
global $wgDefaultExternalStore, $wgContentHandlerUseDB;
-
$this->checkContentModel();
$data = $this->mText;
$wgMemc->set( $key, $text, $wgRevisionCacheExpiry );
}
-
return $text;
}
public static function newNullRevision( $dbw, $pageId, $summary, $minor, $user = null ) {
global $wgContentHandlerUseDB;
-
$fields = array( 'page_latest', 'page_namespace', 'page_title',
'rev_text_id', 'rev_len', 'rev_sha1' );
static $htmlpairsStatic, $htmlsingle, $htmlsingleonly, $htmlnest, $tabletags,
$htmllist, $listtags, $htmlsingleallowed, $htmlelementsStatic, $staticInitialised;
-
// Base our staticInitialised variable off of the global config state so that if the globals
// are changed (like in the screwed up test system) we will re-initialise the settings.
$globalContext = implode( '-', compact( 'wgAllowMicrodataAttributes', 'wgAllowImageTag' ) );
return array( $this->mHasCascadingRestrictions, $pagerestrictions );
}
-
$dbr = wfGetDB( DB_SLAVE );
if ( $this->getNamespace() == NS_FILE ) {
public function checkPassword( $password ) {
global $wgAuth, $wgLegacyEncoding;
-
$this->loadPasswords();
// Certain authentication plugins do NOT want to save
$s = $this->getCredits( -1 );
}
-
return Html::rawElement( 'div', array( 'id' => 'mw-credits' ), $s );
}
}
}
-
return $s;
}
return; // Client cache fresh and headers sent, nothing more to do.
}
-
$this->preCacheMessages();
$config = $this->context->getConfig();
__METHOD__
);
-
return $result;
}
$popts->setIsSectionPreview( $params['sectionpreview'] );
$popts->setEditSection( !$params['disableeditsection'] );
-
return $popts;
}
public function addLinkObj( $nt ) {
global $wgContentHandlerUseDB;
-
$key = $nt->getPrefixedDBkey();
if ( $this->isBadLink( $key ) || $nt->isExternal() ) {
$id = 0;
}
-
return $id;
}
}
}
-
// The JSON format only supports messages, none of the other variables, so wrap the data
return array( 'messages' => $data );
}
$deps['plurals'] = new FileDependency( "$IP/languages/data/plurals.xml" );
$deps['plurals-mw'] = new FileDependency( "$IP/languages/data/plurals-mediawiki.xml" );
-
return $data;
}
$codeSequence = array_merge( array( $code ), $coreData['fallbackSequence'] );
$messageDirs = $this->getMessagesDirs();
-
# Load non-JSON localisation data for extensions
$extensionData = array_combine(
$codeSequence,
}
}
-
# Add cache dependencies for any referenced globals
$deps['wgExtensionMessagesFiles'] = new GlobalDependency( 'wgExtensionMessagesFiles' );
// $wgMessagesDirs is used in LocalisationCache::getMessagesDirs()
$success = true;
}
-
if ( $success ) {
# Done, no need to retry
break;
$this->saveToLocal( $serialized, $hash, $code );
}
-
return $success;
}
function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) {
global $wgContLang;
-
if ( is_int( $key ) ) {
// Fix numerical strings that somehow become ints
// on their way here
$res = $parser->parse( $text, $title, $popts, $linestart );
$this->mInParser = false;
-
return $res;
}
$cacheEntry = $this->cacheEntryFactory->newFromRecentChange( $baseRC, $watched );
$this->addCacheEntry( $cacheEntry );
-
return $ret;
}
$this->rcCacheIndex++;
-
return $r;
}
$r .= "</td></tr></table>\n";
-
return $r;
}
return '';
}
-
$blockOut = '';
foreach ( $this->rc_cache as $block ) {
if ( count( $block ) < 2 ) {
}
}
-
return '<div>' . $blockOut . '</div>';
}
return false;
}
-
$dateheader = ''; // $html now contains only <li>...</li>, for hooks' convenience.
$this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] );
$newContent = new static( $text );
-
return $newContent;
}
$this->mPassword = $password;
$this->mDBname = $dbName;
-
# The kernel's default SYN retransmission period is far too slow for us,
# so we use a short timeout plus a manual retry. Retrying means that a small
# but finite rate of SYN packet loss won't cause user-visible errors.
}
$error = $this->restoreErrorHandler();
-
# Always log connection errors
if ( !$this->mConn ) {
if ( !$error ) {
"Server: $server, User: $user, Password: " .
substr( $password, 0, 3 ) . "..., error: " . $error . "\n" );
-
$this->reportConnectionError( $error );
}
wfDebug( "Error selecting database $dbName on server {$this->mServer} " .
"from client host " . wfHostname() . "\n" );
-
$this->reportConnectionError( "Error selecting database $dbName" );
}
}
}
}
-
return $status;
}
return $this->reportConnectionError();
}
-
return $conn;
}
return array( 0 => 0 );
}
-
$expiry = 5;
$requestRate = 10;
public static function doUpdates( $commit = '' ) {
global $wgDeferredUpdateList;
-
$updates = array_merge( $wgDeferredUpdateList, self::$updates );
// No need to get master connections in case of empty updates array
return;
}
-
$page = WikiPage::newFromID( $this->id, WikiPage::READ_LATEST );
foreach ( SearchEngine::getSearchTypes() as $type ) {
self::HTCPPurge( $urlArr );
}
-
// Remove duplicate URLs
$urlArr = array_unique( $urlArr );
// Maximum number of parallel connections per squid
wfDebug( __METHOD__ . ": $this->path NOT FOUND!\n" );
}
-
return $info;
}
$this->sha1Base36 = wfBaseConvert( $this->sha1Base36, 16, 36, 31 );
}
-
return $this->sha1Base36;
}
}
} while ( false );
-
return is_object( $thumb ) ? $thumb : false;
}
wfIncrStats( 'image_cache_miss' );
}
-
return $this->dataLoaded;
}
$dbw->commit( __METHOD__ ); // commit before anything bad can happen
}
-
if ( $reupload ) {
# Delete old thumbnails
$this->purgeThumbnails();
LinksUpdate::queueRecursiveJobsForTable( $this->getTitle(), 'imagelinks' );
}
-
return true;
}
$this->complete[$func]['subcalls'] = array();
}
- foreach( $this->hieraData as $key => $stats ) {
+ foreach ( $this->hieraData as $key => $stats ) {
list( $parent, $child ) = self::splitKey( $key );
if ( $parent !== null ) {
// Track call tree information
return $version;
}
-}
\ No newline at end of file
+}
global $wgEnotifWatchlist;
global $wgEnotifMinorEdits, $wgEnotifUserTalk;
-
# The following code is only run, if several conditions are met:
# 1. EmailNotification for pages (other than user_talk pages) must be enabled
# 2. minor edits (changes) are only regarded if the global flag indicates so
public function fetchExtendedMetadata( File $file ) {
global $wgMemc;
-
// If revision deleted, exit immediately
if ( $file->isDeleted( File::DELETED_FILE ) ) {
$wgMemc->set( $cacheKey, $valueToCache, $maxCacheTime );
}
-
return $extendedMetadata;
}
return $file->getExtendedMetadata() ?: array();
}
-
$uploadDate = wfTimestamp( TS_ISO_8601, $file->getTimestamp() );
$fileMetadata = array(
}
}
-
return $fileMetadata;
}
}
}
-
return $extendedMetadata;
}
return $this->mContent;
}
-
$content = $this->fetchContentObject();
if ( !$content ) {
$this->mContent = ContentHandler::getContentText( $content );
ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) );
-
return $this->mContent;
}
return $this->mContentObject;
}
-
$this->mContentLoaded = true;
$this->mContent = null;
Hooks::run( 'ArticleAfterFetchContentObject', array( &$this, &$this->mContentObject ) );
-
return $this->mContentObject;
}
public function view() {
global $wgUseFileCache, $wgUseETag, $wgDebugToolbar, $wgMaxRedirects;
-
# Get variables from query string
# As side effect this will load the revision and update the title
# in a revision ID is passed in the request, so this should remain
return false;
}
-
// New page patrol: Get the timestamp of the oldest revison which
// the revision table holds for the given page. Then we look
// whether it's within the RC lifespan and if it is, we try
$pool = new PoolWorkArticleView( $this, $parserOptions, $oldid, $useParserCache );
$pool->execute();
-
return $pool->getParserOutput();
}
) {
global $wgContentHandlerUseDB;
-
$content = $revision->getContent();
$len = $content ? $content->getSize() : 0;
$rt = $content ? $content->getUltimateRedirectTarget() : null;
throw new MWException( 'Something is trying to edit an article with an empty title' );
}
-
if ( !$content->getContentHandler()->canBeUsedOn( $this->getTitle() ) ) {
return Status::newFatal( 'content-not-allowed-here',
ContentHandler::getLocalizedName( $content->getModel() ),
public function doEditUpdates( Revision $revision, User $user, array $options = array() ) {
global $wgEnableParserCache;
-
$options += array(
'changed' => true,
'created' => false,
$this->replaceInternal( $text );
$this->replaceInterwiki( $text );
-
}
/**
}
$this->mFirstCall = false;
-
CoreParserFunctions::register( $this );
CoreTagHooks::register( $this );
$this->initialiseVariables();
$out = '';
}
-
return $out;
}
$wgCleanSignatures, $wgExternalLinkTarget, $wgExpensiveParserFunctionLimit,
$wgMaxGeneratedPPNodeCount, $wgDisableLangConversion, $wgDisableTitleConversion;
-
// *UPDATE* ParserOptions::matches() if any of this changes as needed
$this->mInterwikiMagic = $wgInterwikiMagic;
$this->mAllowExternalImages = $wgAllowExternalImages;
if ( $cacheable ) {
}
-
if ( !$result ) {
throw new MWException( __METHOD__ . ' generated invalid XML' );
}
$stack->rootAccum .= '</root>';
$xml = $stack->rootAccum;
-
return $xml;
}
}
}
}
-
-
}
public function getExtractedInfo() {
$this->errors[] = self::formatExceptionNoComment( $e );
}
-
return $result;
}
public function __construct( Config $config = null ) {
global $IP;
-
if ( $config === null ) {
wfDebug( __METHOD__ . ' was called without providing a Config instance' );
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
. 'Edit your <code>LocalSettings.php</code> to enable it.' );
}
-
// Get core test suites
$testModules = array();
$testModules['qunit'] = array();
// See http://bugs.php.net/bug.php?id=36514
ob_start();
-
// Find out which modules are missing and instantiate the others
$modules = array();
$missing = array();
$this->errors[] = self::formatExceptionNoComment( $e );
}
-
// To send Last-Modified and support If-Modified-Since, we need to detect
// the last modified time
$mtime = wfTimestamp( TS_UNIX, $this->config->get( 'CacheEpoch' ) );
}
}
-
// If there's an If-Modified-Since header, respond with a 304 appropriately
if ( $this->tryRespondLastModified( $context, $mtime ) ) {
return; // output handled (buffers cleared)
no modules were requested. Max made me put this here. */";
}
-
$image = $context->getImageObj();
if ( $image ) {
$data = $image->getImageData( $context );
$all = $textExt + $otherExt; // these have disjunct key sets
-
// prepare regexps
foreach ( $terms as $index => $term ) {
// manually do upper/lowercase stuff for utf-8 since PHP won't do it
$pat1 = "/(" . $phrase . ")/ui";
$pat2 = "/$patPre(" . $anyterm . ")$patPost/ui";
-
$left = $contextlines;
$snippets = array();
}
}
-
return $extract;
}
function normalizeText( $string ) {
global $wgContLang;
-
$out = parent::normalizeText( $string );
// MySQL fulltext index doesn't grok utf-8, so we
"$1u82e$2",
$out );
-
return $out;
}
private function getCachedNotice( $name ) {
global $wgRenderHashAppend, $parserMemc, $wgContLang;
-
$needParse = false;
if ( $name === 'default' ) {
$this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage );
}
-
-
return $tpl;
}
$wgShowCreditsIfMax, $wgArticlePath,
$wgScriptPath, $wgServer;
-
$title = $this->getTitle();
$request = $this->getRequest();
$out = $this->getOutput();
$tpl->set( 'userlangattributes', $attrs );
}
-
$tpl->set( 'newtalk', $this->getNewtalks() );
$tpl->set( 'logo', $this->logoText() );
protected function buildContentNavigationUrls() {
global $wgDisableLangConversion;
-
// Display tabs for the relevant title rather than always the title itself
$title = $this->getRelevantTitle();
$onPage = $title->equals( $this->getTitle() );
);
}
-
// Checks if user can edit the current page if it exists or create it otherwise
if ( $title->quickUserCan( 'edit', $user )
&& ( $title->exists() || $title->quickUserCan( 'create', $user ) )
);
}
-
// Checks if the user is logged in
if ( $this->loggedin && $user->isAllowedAll( 'viewmywatchlist', 'editmywatchlist' ) ) {
/**
}
}
-
return $content_navigation;
}
*/
private function buildContentActionUrls( $content_navigation ) {
-
// content_actions has been replaced with content_navigation for backwards
// compatibility and also for skins that just want simple tabs content_actions
// is now built by flattening the content_navigation arrays into one
}
}
-
return $content_actions;
}
protected function buildNavUrls() {
global $wgUploadNavigationUrl;
-
$out = $this->getOutput();
$request = $this->getRequest();
// Normalise message names so they look like page titles
$messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
-
return $messageNames;
}
}
}
-
return array( 'pages' => $pageFlags, 'talks' => $talkFlags );
}
$ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n";
}
-
return $ret;
}
$ret = Html::rawElement( 'li', array(), $ret ) . "\n";
-
return $ret;
}
$this->userGroupCache = $cache;
// Add page of groups to link batch
- foreach( $groups as $group => $unused ) {
+ foreach ( $groups as $group => $unused ) {
$groupPage = User::getGroupPage( $group );
if ( $groupPage ) {
$batch->addObj( $groupPage );
$batch->execute();
$this->mResult->seek( 0 );
-
return '';
}
)->escaped();
}
-
// @todo i18n: This should use a comma separator instead of a hard coded comma, right?
return '<li>' . $lang->specialList( $link, implode( $description_items, ', ' ) ) . "</li>\n";
}
)->text();
}
-
return $version;
}
}
}
-
return $v;
}
return array( 'status' => self::HOOK_ABORTED, 'error' => $error );
}
-
return array( 'status' => self::OK );
}
}
}
-
return true;
}
return array( 'uploadvirus', $virus );
}
-
return true;
}
}
}
-
return $warnings;
}
$this->postProcessUpload();
}
-
return $status;
}
$file = $stash->stashFile( $this->mTempPath, $this->getSourceType() );
$this->mLocalFile = $file;
-
return $file;
}
wfDebug( __METHOD__ . ": FOUND VIRUS! scanner feedback: $output \n" );
}
-
return $output;
}
wfDebug( __METHOD__ . ": " . strlen( $buffer ) .
" bytes of randomness leftover in the buffer.\n" );
-
return $generated;
}